package tk.heimashuma.store.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import tk.heimashuma.store.entity.CommodityType;

import java.util.List;

public interface CommodityTypeReposity extends JpaRepository<CommodityType,Integer> {
    @Query("SELECT tname from CommodityType where description = null")
    List<CommodityType> findCommodityTypeFirst();
    @Query("select ctid from CommodityType where tname = ?1")
    Integer findIdByTname(String name);
    @Query("select ctid,tname from CommodityType where description = ?1")
    List<CommodityType> findTnameByDescription(Integer description);
    @Query("select ctid,tname from CommodityType where description is not null")
    List<CommodityType> findAllTname();
}
